<template>
	<view class="code-img-box">
		<image :src="qrCodeImg" mode="widthFix"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				qrCodeImg: ''
			}
		},
		onLoad() {
			this.CodeDetail();
		},
		methods: {
			CodeDetail() {
				let that = this
				uni.login({
					success: (loginCode) => {
						let {
							code
						} = loginCode;
						that.$api.post({
							url: '/user/qrcode',
							data: {
								code
							},
							success: (res) => {
								that.qrCodeImg = res.img;
							}
						})
					}
				})
			}
		}
	}
</script>

<style scoped>
.code-img-box {
	width: 100%;
	height: 100%;
	position: absolute;
	background-color: white;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 20rpx;
	box-sizing: border-box;
}
.code-img-box image {
	width: 100%;
}
</style>
